this.BX=this.BX||{};(function(e,t,n){"use strict";var i,r,o;function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(e){babelHelpers.inherits(n,e);function n(){var e;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,n);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(n).call(this));e.cache=new t.Cache.MemoryCache;e.data=s({},i);e.options=e.data;e.id=t.Type.isStringFilled(e.options.id)?e.options.id:t.Text.getRandom();e.hidden=t.Text.toBoolean(e.options.hidden);e.onClickHandler=t.Type.isFunction(e.options.onClick)?e.options.onClick:function(){};e.onClick=e.onClick.bind(babelHelpers.assertThisInitialized(e));e.layout=e.getLayout();e.header=e.getHeader();e.body=e.getBody();e.setTitle(e.options.title||"");e.setHidden(e.options.hidden);if(t.Type.isStringFilled(e.options.className)){t.Dom.addClass(e.layout,e.options.className)}if(t.Type.isObject(e.options.attrs)){t.Dom.adjust(e.layout,{attrs:e.options.attrs})}t.Event.bind(e.layout,"click",e.onClick);return e}babelHelpers.createClass(n,[{key:"getLayout",value:function e(){var n=this;return this.cache.remember("layout",(function(){return t.Tag.render(i||(i=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-card">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),n.getHeader(),n.getBody())}))}},{key:"getHeader",value:function e(){return this.cache.remember("header",(function(){return t.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-card-header"></div>\n\t\t\t'])))}))}},{key:"getBody",value:function e(){return this.cache.remember("body",(function(){return t.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-card-body"></div>\n\t\t\t'])))}))}},{key:"setTitle",value:function e(t){this.getHeader().textContent=t}},{key:"setHidden",value:function e(n){t.Dom.attr(this.getLayout(),"hidden",n||null)}},{key:"onClick",value:function e(){this.onClickHandler(this);this.emit("onClick")}},{key:"show",value:function e(){this.setHidden(false)}},{key:"isShown",value:function e(){return t.Dom.attr(this.getLayout(),"hidden")===null}},{key:"hide",value:function e(){this.setHidden(true)}},{key:"getNode",value:function e(){return this.getLayout()}}]);return n}(n.EventEmitter);var c,u,d,p,h;var g=function(e){babelHelpers.inherits(n,e);function n(e){var i;babelHelpers.classCallCheck(this,n);i=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(n).call(this,e));t.Dom.addClass(i.getLayout(),"ui-card-message");i.onCloseClick=i.onCloseClick.bind(babelHelpers.assertThisInitialized(i));if(i.options.angle===false){t.Dom.addClass(i.getLayout(),"ui-card-message-without-angle")}if(t.Type.isStringFilled(i.options.icon)){t.Dom.append(i.getIcon(),i.getHeader())}if(!t.Type.isArray(i.options.actionElements)){i.options.actionElements=[]}t.Dom.append(i.getTitle(),i.getHeader());t.Dom.append(i.getDescription(),i.getBody());if(i.options.closeable!==false){t.Dom.append(i.getCloseButton(),i.getLayout())}if(i.options.hideActions!==true||i.options.more){t.Dom.append(i.getActionsContainer(),i.getLayout())}if(i.isAllowRestoreState()){var r=n.cache.get(i.options.id,{shown:true});if(r.shown){i.show()}else{i.hide()}}return i}babelHelpers.createClass(n,[{key:"isAllowRestoreState",value:function e(){return this.options.restoreState&&this.options.id}},{key:"getIcon",value:function e(){var n=this;return this.cache.remember("icon",(function(){return t.Tag.render(c||(c=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-card-message-icon" style="background-image: url(',')"></div>\n\t\t\t'])),n.options.icon)}))}},{key:"getTitle",value:function e(){var n=this;return this.cache.remember("title",(function(){return t.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-card-message-title">',"</div>\n\t\t\t"])),n.options.header)}))}},{key:"getDescription",value:function e(){var n=this;return this.cache.remember("description",(function(){return t.Tag.render(d||(d=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-card-message-description">',"</div>\n\t\t\t"])),n.options.description)}))}},{key:"getCloseButton",value:function e(){var n=this;return this.cache.remember("closeButton",(function(){return t.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div \n\t\t\t\t\tclass="ui-card-message-close-button" \n\t\t\t\t\tonclick="','"\n\t\t\t\t></div>\n\t\t\t'])),n.onCloseClick)}))}},{key:"onCloseClick",value:function e(t){t.preventDefault();this.hide();this.emit("onClose");n.cache.set(this.options.id,{shown:false})}},{key:"getActionsContainer",value:function e(){var n=this;return this.cache.remember("actionsContainer",(function(){var e=t.Tag.render(h||(h=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-card-message-actions"></div>\n\t\t\t'])));n.options.actionElements.forEach((function(t){e.appendChild(t)}));return e}))}},{key:"onClick",value:function e(){this.onClickHandler(this);this.emit("onClick")}}]);return n}(l);babelHelpers.defineProperty(g,"cache",new t.Cache.MemoryCache);e.MessageCard=g})(this.BX.UI=this.BX.UI||{},BX,BX.Event);
//# sourceMappingURL=messagecard.bundle.map.js